home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 3.2 / Ham Radio Version 3.2 (Chestnut CD-ROMs)(1993).ISO / packet / n17jsrc / eccmd.c < prev    next >
C/C++ Source or Header  |  1991-02-04  |  935b  |  39 lines

  1. /* 3C501 commands
  2.  * Copyright 1991 Phil Karn, KA9Q
  3.  */
  4. #include <stdio.h>
  5. #include "global.h"
  6. #include "mbuf.h"
  7. #include "iface.h"
  8. #include "ec.h"
  9. #include "enet.h"
  10.  
  11. int
  12. doetherstat(argc,argv,p)
  13. int argc;
  14. char *argv[];
  15. void *p;
  16. {
  17.     register struct ec *ecp;
  18.     char buf[20];
  19.  
  20.     for(ecp = Ec;ecp < &Ec[Nec]; ecp++){
  21.         pether(buf,ecp->iface->hwaddr);
  22.         tprintf("Controller %u, Ethernet address %s\n",
  23.         (unsigned int)((ecp-Ec) / sizeof(struct ec)),buf);
  24.  
  25.         tprintf("recv      bad       overf     drop      nomem     intrpt\n");
  26.         tprintf("%-10lu%-10lu%-10lu%-10lu%-10lu%-10lu\n",
  27.          ecp->estats.recv,ecp->estats.bad,ecp->estats.over,
  28.          ecp->estats.drop,ecp->estats.nomem,ecp->estats.intrpt);
  29.  
  30.         tprintf("xmit      timeout   jam       jam16\n");
  31.         if(tprintf("%-10lu%-10lu%-10lu%-10lu\n",
  32.          ecp->estats.xmit,ecp->estats.timeout,ecp->estats.jam,
  33.          ecp->estats.jam16) == EOF)
  34.             break;
  35.     }
  36.     return 0;
  37. }
  38.  
  39.